
<%@ tag import="com.project.util.StringUtil"%>
<%@ tag pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>

<%@ attribute name="htmlStr"%>
<%@ attribute name="length"%>
<%@ attribute name="end"%>
<%@ attribute name="style"%>
<%@ attribute name="styleClass"%>

<c:choose>
	<c:when test="${htmlStr.length()>length}">
			<%=StringUtil.subStringHTML(htmlStr, Integer.parseInt(length), "...") %>
	</c:when>
	<c:otherwise>
		${htmlStr}
	</c:otherwise>
</c:choose>


























<%-- 

<script type="text/javascript">
<%
String ctx =  request.getContextPath();
%>

function subStringHTML(htmlStr,length,end){
	$.ajax({
		url:"<%=ctx %>/home/subStringHTML",
		type:"POST",
		dataType:"text",
		async:false,  
		data:"htmlStr="+val+"&length="+length+"&end="+end,
		success:function(data){
			htmlStr=data;
		}
	});
}

</script>

<%@ attribute name="htmlStr"%>
<%@ attribute name="length"%>
<%@ attribute name="end"%>
<%@ attribute name="style"%>
<%@ attribute name="styleClass"%>

<span style="${style}" class="${styleClass}">${htmlStr}</span> --%>